﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Users/MasterPage.master" AutoEventWireup="true"
    CodeFile="Home.aspx.cs" Inherits="Users_Home" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <div align="left">
        <div class="contact_form">
            <div class="form_subtitle">
                <asp:Label ID="lblWelcome" runat="server" Text="Label"></asp:Label>
            </div>
            <br />
            <b>Your sky meter :
            <asp:Label ID="lblSkyMeter" runat="server" Text="Label"></asp:Label>
            </b>
            <br />
            <br />
            <b>Total Tickets</b><asp:GridView ID="GridView1" runat="server" 
                AutoGenerateColumns="False" DataSourceID="SqlDataSource1" Width="162px">
                <Columns>
                    <asp:BoundField DataField="TicketStatus" HeaderText="Ticket Status" 
                        SortExpression="TicketStatus" />
                    <asp:BoundField DataField="Expr1" DataFormatString="{0} ticket(s)" 
                        HeaderText="Total" ReadOnly="True" SortExpression="Expr1" />
                </Columns>
                <EmptyDataTemplate>
                    You haven&#39;t had any ticket yet
                </EmptyDataTemplate>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:sqlString %>" 
                oninit="SqlDataSource1_Init" 
                SelectCommand="SELECT COUNT(TicketID) AS Expr1, TicketStatus FROM Airline_Ticket GROUP BY TicketStatus, UserID HAVING (UserID = @UserID)">
                <SelectParameters>
                    <asp:Parameter Name="UserID" />
                </SelectParameters>
            </asp:SqlDataSource>
        </div>
    </div>
</asp:Content>
